<script setup>
import { onMounted, ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { detailsApi } from "@/services/cloudlibrary";
import { useWebSocket } from "@/utils/socket/useWebSocket";

const toke = ref(uni.getStorageSync("X-Auth-Token"));

const { data, connected, sendMessage } = useWebSocket(
  "ws://dev-retail.yibaitao.cn/message/bus?X-Auth-Token=" + toke
);

onLoad((e) => {
  id.value = e.id;
  shop_id.value = e.shop_id;
});
watch(data, (newData) => {
  console.log("Data updated:", newData);
  console.log("connected", connected);
});
</script>

<template>
  <view class="container"> </view>
</template>

<style lang="scss" scoped></style>
